<template>
    <div class="tourist">
        <div class="top">
            <div class="left">
                <span class="title">实时游客统计</span>
                <img src="../images/dataScreen-title.png">
            </div>
            <p class="right">可预约总量 <span>987654</span> 人</p>
        </div>
        <div class="number">
            <span v-for="item in people" key="index">{{ item }}</span>
        </div>
        <!-- 显示水球图 -->
        <div class="charts" ref="charts">123</div>
    </div>
</template>

<script setup lang="ts">
import * as echarts from 'echarts';
import 'echarts-liquidfill'
import { onMounted, ref } from 'vue'
let people = ref<string>('672108人');
// 获取节点
let charts = ref();
onMounted(() => {
    // 获取echarts类的实例
    let mycharts = echarts.init(charts.value);
    // 设置实例的配置项
    mycharts.setOption({
        // 标题组件
        // 系列：展示的图形图标类型
        series: {
            type: 'liquidFill', // 系列
            data: [0.68, 0.4, 0.2], // 数据时
            waveAnimation: true, // 展示动画
            radius: '80%'
        },
        // 布局组件
        grid: {
            left: 0,
            right: 0,
            top: 0,
            bottom: 0
        }
    })
})
</script>

<style scoped lang="scss">
.tourist {
    flex: 1.2;
    background: url(../images/dataScreen-main-lb.png) no-repeat;
    background-size: 100% 100%;
    margin-top: 10px;
    font-size: 23px;
    // color: white;

    .top {
        display: flex;
        justify-content: space-between;
        height: 75px;
        margin-left: 20px;

        .left {
            display: flex;
            flex-direction: column;
            justify-content: space-evenly;

            img {
                width: 68px;
                height: 7px;
            }
        }

        .right {
            font-size: 20px;
            margin-top: 50px;
            margin-right: 20px;

            span {
                color: orange
            }
        }
    }

    .number {
        display: flex;
        margin: 10px 5px;

        span {
            font-size: 35px;
            flex: 1;
            height: 65px;
            text-align: center;
            line-height: 65px;
            background: url(../images/total.png) no-repeat;
            background-size: 100% 100%;
            margin: 0 2px;
            color: aqua;

        }
    }

    .charts {
        width: 100%;
        height: 270px;
    }
}
</style>